package com.example.his.api.db.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.his.api.db.pojo.CustomerEntity;

import java.util.HashMap;

public interface CustomerDao extends BaseMapper<CustomerEntity> {

    default Integer searchIdByTel(String tel){
        QueryWrapper<CustomerEntity> select = Wrappers.<CustomerEntity>query()
                .eq("tel", tel)
                .select("id");
        CustomerEntity entity = selectOne(select);
        return entity != null ? entity.getId() : null;
    }




}




